#!/bin/bash

params=$@

[ $# -eq 0 ] && { echo "$0: Missing params" ; echo "Usage: $0 r1.1.0" ; exit 1 ; }

fullpath=`pwd -P .`
cd $fullpath


echo "--------------------------------------------------"
echo "Ready to git checkout new branch: $params"
echo "--------------------------------------------------"

for f in */ ; do
    if [ -d "$f" ] ; then
      echo "------------------------< $f >"
    	cd $f
    	branch=`git rev-parse --abbrev-ref HEAD`
	if [ "$branch" != "master" ] ; then
		git checkout -b $params
		git push origin $params;
	fi ;
    	cd $fullpath ;
    fi ;
done ;    







